package com.lcxw.hxzbapi.service;

import com.lcxw.hxzbapi.entity.pojo.Attention;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import com.lcxw.hxzbapi.dao.mapper.AttentionMapper;

@Component
@Service
public class AttentionService {

    @Resource
    AttentionMapper attentionMapper;

    public List<Long> getAttentionUserbyUserId(long userId) {
        return attentionMapper.selectAttuidByUserId(userId);
    }

    public List<Long> getAttentionRoombyUserId(long userId) {
        return attentionMapper.selectAttroomidByUserId(userId);
    }

    public int getCountOfAttuid(long attuid) throws Exception {
        return attentionMapper.selectCountOfAttuid(attuid);
    }

    public int addAttentionUser(long userId, long attuid, String attype, String addTime)
        throws Exception {
        return attentionMapper.addAttentionUser(userId, attuid, attype, addTime);
    }

    public int deleteAttentionUser(long userId, long attuid, String attype) throws Exception {
        return attentionMapper.deleteAttentionUser(userId, attuid, attype);
    }

    public Attention getAttentionByUserIdAndAttuId(long userId, long attuId, String attype) {
        return attentionMapper.getAttentionByUserIdAndAttuId(userId, attuId, attype);
    }

    public List<Long> getFans(long attuId, String attype) {
        return attentionMapper.getFans(attuId, attype);
    }

    public int getFansNum(long attuId) {
        return attentionMapper.getFansNum(attuId);
    }

}
